LibMerge Library API Guide

To use the LibMerge library, create an instance of the LibMerger class.

LibMerger Class
---------------

Methods:

AddLibrary(library as FolderItem) - Adds the library passed to the list of Libraries to merge. If the library passed supports as project type is already supported by a library previously passed, this method will raise an UnsupportedFormatException.

Count As Integer - Returns the number of Libraries already added.

LibraryInfo As JSONItem - Returns the JSONItem object that will be used for the Version, Copyright and Description properties of the merged Library that will ultimately be created.

LibraryToMergeAt(index As Integer) As LibToMerge - Returns the LibToMerge (the internal class type that represents a Library to be merged) item at the index passed.

RemoveAllLibraries - Removes all the Libraries previously added from the list of Libraries to merge.

RemoveLibrary(libToMerge) - Removes the LibToMerge item from the list of Libraries to merge.

SaveMergedLibraryTo(mergedLib As FolderItem) - Creates the merged Library with the name and at the location in the mergedLib FolderItem passed.

TemporaryFolder As FolderItem - Returns the temporary folder created to store copies of the libraries being merged.

LibToMerge Class
----------------

Properties:

File As FolderItem - the FolderItem that represents the Library.
SupportedTypes() As String - the project types supported by this Library. Values can be Android, Console. Desktop, iOS, and Web.

Example Code
------------

Try
  Var merge As New LibMerger
  merge.AddLibrary(SpecialFolder.Desktop.Child("MyDesktopLibrary.xojo_library"))
  merge.AddLibrary(SpecialFolder.Desktop.Child("MyWebLibrary.xojo_library"))
  merge.SaveMergedLibrary(SpecialFolder.Desktop.Child("MergedLibrary.xojo_library"))
Catch error as UnsupportedFormatException
  System.Beep
  MessageBox(error.Message)
End Try